#ifndef WINDOWSWINDOW_H
#define WINDOWSWINDOW_H

#include "Core/window.h"
#include "Renderer/graphicsContext.h"

#include <GLFW/glfw3.h>
#define GLFW_EXPOSE_NATIVE_WIN32
#include <GLFW/glfw3native.h>

namespace CC {

	class WindowsWindow : public Window
	{
	public:
		WindowsWindow(const WindowProps& props);
		virtual ~WindowsWindow();

		void OnUpdate() override;

		unsigned int GetWidth() const override { return m_Data.Width; }
		unsigned int GetHeight() const override { return m_Data.Height; }

		// Window attributes
		void SetEventCallback(const EventCallbackFn& callback) override { m_Data.EventCallback = callback; }
		void SetVSync(bool enabled) override;
		bool IsVSync() const override;

		virtual void* GetNativeWindow() const { return m_Window; }

		virtual HWND GetNativeWindowID() const { return glfwGetWin32Window(m_Window); }

		virtual void SetIsDesktopFlag(bool state) override;

        virtual void SetFullScreen() override;
        virtual void SetNoTitleFullScreen() override;

        virtual void SetWindowTitle(std::string name) override;
	private:
		virtual void Init(const WindowProps& props);
		virtual void Shutdown();
		void WINAPI QueryKeyAndMouse();
	private:
		GLFWwindow* m_Window;
		GraphicsContext* m_Context;

		bool stopped = false;
		POINT pointCaret = { 0, 0 };
		POINT pointMouse = { 0, 0 };

		struct WindowData
		{
			std::string Title;
			unsigned int Width, Height;
			bool VSync;
			bool IsDesktop;
            bool Floating;//top window
            bool HasTitle;

			EventCallbackFn EventCallback;
		};

		WindowData m_Data;

	};

}

#endif